---能量增减2
---@class BuffEffect61 : BaseBuffEffect
BuffEffect61 = ClientFight.CreateClass("BuffEffect61", ClientFight.BaseBuffEffect)
local t = BuffEffect61
---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local calculatorType = buff.buffBean.f_BuffEffectValue[1];
    local calcType = buff.buffBean.f_BuffEffectValue[2];
    local plus = buff.buffBean.f_BuffEffectValue[3];
    local calcValue = buff.buffBean.f_BuffEffectValue[4];
    local toFighter = calculatorType == 0 and buff.source or buff.target;
    local skill = buff.skill;
    local energy = 0;
    if calcType == 1 then
        energy = calcValue;
    elseif calcType == 2 then
        energy = calcRatio(toFighter.energy, calcValue);
    end

    if (energy > 0) then
        if (plus == 1) then
            ClientFight.FighterManager.addEnergy(fight, toFighter, skill.skill.skillBean.f_SkillID, skill.frame, energy, EnergyChangeReasonEnum.BUFF);
        else
            ClientFight.FighterManager.addEnergy(fight, toFighter, skill.skill.skillBean.f_SkillID, skill.frame, -energy, EnergyChangeReasonEnum.BUFF);
        end
    end
    return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
end

t.New()